package com.example.firstactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;

import com.example.firstactivity.ListView.LixtViewActivity;
import com.example.firstactivity.gridview.GridViewActivity;

public class MainActivity extends AppCompatActivity {

    private Button mBtnRadioButton;
    private Button mBtnCheckBox;
    private Button mBtnImageView;
    private Button mBtnListView;
    private Button mBtnGridView;
    private Button mBtnTable;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mBtnRadioButton = (Button) findViewById(R.id.btn_radiobutton);
        mBtnRadioButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到RadioButton演示界面
                Intent intent = new Intent(MainActivity.this,RadiobuttonActivity.class);
                startActivity(intent);
            }
        });
        mBtnCheckBox = (Button) findViewById(R.id.btn_checkbox);
        mBtnCheckBox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到RadioButton演示界面
                Intent intent = new Intent(MainActivity.this, CheckBoxActivity.class);
                startActivity(intent);
            }
        });
        mBtnImageView = (Button) findViewById(R.id.btn_imageview);
        mBtnImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到ImageView演示界面
                Intent intent = new Intent(MainActivity.this,ImageActivity.class);
                startActivity(intent);
            }
        });
        mBtnListView = (Button) findViewById(R.id.btn_listview);
        mBtnListView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到ListView演示界面
                Intent intent = new Intent(MainActivity.this, LixtViewActivity.class);
                startActivity(intent);
            }
        });
        mBtnGridView = (Button) findViewById(R.id.btn_gridview);
        mBtnGridView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到ListView演示界面
                Intent intent = new Intent(MainActivity.this, GridViewActivity.class);
                startActivity(intent);
            }
        });
        mBtnTable = (Button) findViewById(R.id.btn_table);
        mBtnTable.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到Table演示界面
                Intent intent = new Intent (MainActivity.this,TableActivity.class);
                startActivity(intent);
            }
        });

    }
}
